﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KC.Business.Humor
{
	public static class LoadingMessages
	{
		public static string GetMessage()
		{
			int val = new Random().Next(0, 1);
			switch (val)
			{
				case 0: return LoadFromFile();
				case 1: return Generate1();
				default: return null;
			}

		}

		private static string LoadFromFile()
		{
			string[] lines = System.IO.File.ReadAllLines(@"c:\KC\Business\Humor\LoadingMessages.txt");
			return lines[new Random().Next(0, lines.Length - 1)];
		}
		private static string Generate1()
		{
			string[]
				Prefixes = new string[]
					{
						"Recalibrating",		"Excavating",		"Finalizing",
						"Reticulating",		"Acquiring",		"Locking",
						"Fueling",			"Extracting",		"Binding",
						"Transglutinating",		"Fine-tuning",		"Reconfoobling",
						"Acetylating",			"Condensing",		"Expanding",
						"Decondensing",		"Loading",		"Commencing",
						"Completing",			"Editing",		"Splicing",
						"Detecting",			"Configuring",		"Transporting",
						"Synthesizing"
					},
				Fixes = new string[]
					{
						"flux",			"data",			"spline",		"storage",
						"plasma",			"cache",			"laser",		"injector",
						"radiant",		"histone",		"chromatin",	"transcription",
						"transactional",	"intron",			"codon",		"messenger",
						"intergalactic",	"intragalactic",	"protein",	"product"
					},
				Suffixes = new string[]
					{
						"capacitor",			"assembler",		"conductor",
						"disk",				"detector",		"integrator",
						"post-processor",		"pre-processor",	"processor",
						"goatherd",			"energymotron",	"sequence"
					};
			Random rand = new Random();
			return
				Prefixes[rand.Next(0, Prefixes.Length - 1)] + " " +
				Fixes[rand.Next(0, Fixes.Length - 1)] + " " +
				Suffixes[rand.Next(0, Suffixes.Length - 1)] + "...";
		}
	}
}
